-- card: 2150 from stack: in.3 -- bmap block id: 0 -- flags: 4000 -- background id: 2663 -- name: Item Select -- part 1 (field) -- low flags: 01 -- high flags: 4007 -- rect: left=280 top=82 right=241 bottom=500 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 4 -- text size: 9 -- style flags: 0 -- line height: 14 -- part name: Item Select ----- HyperTalk script ----- on copyright -- Item Select, Copyright by Mac Help Co., January 1988 -- by Chris Hostetter, Mac Help Co., 1800 East Market Street -- Long Beach, CA 90805, (213) 428-7414 -- The script for this field is copyrighted and may not be -- used without the written permission of the author (above). end copyright on mouseUp Global ThisItem, ThisLine, ThisField -- NOTE: THIS BUTTON CAN ALSO USE A HILITER BUTTON. SIMPLY CREATE -- A NEW BUTTON ON THE SAME CARD OR BACKGROUND THAT THIS FIELD IS ON. -- NAME THE BUTTON 'HILIGHTER' AND SET THE BUTTON TO TRANSPARENT -- put false into UseHilighter (below) if you don't want a hilighter put TRUE into UseHilighter set numberformat to 0 put the clickLoc into ThisMouseLoc set cursor to 4 put the name of the target into WhatField put word 1 of WhatField into StackLocation put the rect of whatField into FieldRect put item 1 of FieldRect into X -- Left of Rect put item 2 of FieldRect into Y -- Top of Rect put item 3 of FieldRect into XX -- Right of Rect put item 4 of FieldRect into YY -- Bottom of Rect put (YY - Y) / the textheight of whatField into TotalZones put (YY - Y) / TotalZones into ZoneDepth put item 2 of ThisMouseLoc - Y into MouseDepth put the trunc of ((MouseDepth / ZoneDepth) + 1) into whichZone put the scroll of whatField / the textHeight of whatField into HiddenLines put the round of HiddenLines into HiddenLines put whichZone + HiddenLines into ThisLine do "put line" && ThisLine && "of" && whatField && "into ThisItem" if UseHilighter is true then --MOVE HILIGHTER BUTTON TO PROPER ZONE put Y + ((whichZone-1)*ZoneDepth) into ButY put the trunc of ButY into ButY put the trunc of (ButY+ZoneDepth) into ButYY if StackLocation is "Card" then if the style of whatField is "Scrolling" then set the rect of Card button "Hilighter" to X+1,ButY+1,XX-17,ButYY-1 else set the rect of Card button "Hilighter" to X+1,ButY+1,XX-1,ButYY-1 end if set the hilite of Card button "Hilighter" to true show Card button "Hilighter" Hide Card button "Hilighter" else if the style of whatField is "Scrolling" then set the rect of background button "Hilighter" to X+1,ButY+1,XX-17,ButYY-1 else set the rect of background button "Hilighter" to X+1,ButY+1,XX-1,ButYY-1 end if set the hilite of background button "Hilighter" to true show background button "Hilighter" Hide background button "Hilighter" end if end if -- ************************************************** -- The information is in the variable 'ThisItem' ask "This is what you selected:" with ThisItem -- ************************************************** end mouseUp -- part 2 (button) -- low flags: 00 -- high flags: 8005 -- rect: left=280 top=245 right=267 bottom=488 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: SHOW the Hilighter Button ----- HyperTalk script ----- on mouseUp put the name of the target into ThisName if the visible of card button "Hilighter" is true then hide card button "Hilighter" set the name of ThisName to "SHOW the Hilighter Button" else show card button "Hilighter" set the name of ThisName to "HIDE the Hilighter Button" end if end mouseUp -- part 3 (button) -- low flags: 80 -- high flags: 4000 -- rect: left=281 top=83 right=95 bottom=483 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Hilighter -- part 4 (button) -- low flags: 00 -- high flags: 8003 -- rect: left=281 top=54 right=76 bottom=450 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Enter items into list ----- HyperTalk script ----- on mouseUp ask "What do you want to put in the list?" put it into ThisItem if it is empty then exit mouseUp put the number of lines of card field ID 1 into TotalLines answer "On what line do you want to put it?" with "Line #" or "end of list" if it is "Line #" then ask "Enter the line number" put it into ThisLine if it is empty then exit mouseUp put ThisItem & Return before line ThisLine of card field ID 1 else put ThisItem & Return after line TotalLines of card field ID 1 end if end mouseUp -- part 5 (button) -- low flags: 00 -- high flags: 8003 -- rect: left=281 top=28 right=50 bottom=450 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: List is LOCKED ----- HyperTalk script ----- on mouseUp put the name of the target into ThisName if locktext of card field ID 1 is true then set locktext of card field ID 1 to false set the hilite of ThisName to True set the name of ThisName to "List is UN-LOCKED" else set locktext of card field ID 1 to true set the hilite of ThisName to false set the name of ThisName to "List is LOCKED" end if end mouseUp -- part 6 (button) -- low flags: 00 -- high flags: 8003 -- rect: left=281 top=269 right=291 bottom=381 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Sort List ----- HyperTalk script ----- on copyright -- Super Delete, Copyright by Mac Help Co., January 1988 -- by Chris Hostetter, Mac Help Co., 1800 East Market Street -- Long Beach, CA 90805, (213) 428-7414 -- The script for this button is copyrighted and may not be -- used without the written permission of the author (above). end copyright on mouseUp Global TrapFieldName -- Uses the script "on MouseWithin" located in the script of the stack set the loc of the message box to 20,300 put "MOVE pointer inside field list to Sort then press" && "COMMAND KEY down." put "Sort List" into TrapFieldName put empty into LastField end mouseUp -- part 7 (field) -- low flags: 01 -- high flags: 0004 -- rect: left=440 top=24 right=39 bottom=500 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: See Script ----- HyperTalk script ----- on mouseUp edit script of card button ID 5 end mouseUp -- part 8 (field) -- low flags: 01 -- high flags: 0004 -- rect: left=439 top=51 right=66 bottom=499 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: See Script ----- HyperTalk script ----- on mouseUp edit script of card button ID 4 end mouseUp -- part 9 (field) -- low flags: 01 -- high flags: 0004 -- rect: left=452 top=70 right=85 bottom=512 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: See Script ----- HyperTalk script ----- on mouseUp edit script of card field "Item Select" end mouseUp -- part 10 (field) -- low flags: 01 -- high flags: 0004 -- rect: left=374 top=267 right=282 bottom=434 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: See Script ----- HyperTalk script ----- on mouseUp edit script of card Button "Sort List" end mouseUp -- part contents for background part 8 ----- text ----- Card 12 of 20 -- part contents for background part 9 ----- text ----- ITEM SELECT This field allows you to select any item in the list by simply clicking on the item. The item will be put in the global variable called 'THISITEM' This field works well both as a scrolling field, or as a rectangle field (or any type of field. ) It must be locked for it to work. You could temporarily unlock the field to type in it, or you could use commands (click on the button 'Enter items into list') to insert items into the list. You can make a transparent button titled HILIGHTER, and it will automatically position itself of the selected field for visual feedback. SORT LIST The script of the sort list button is located in the stack scripts section (see on SortList). It will remove every blank line in a field, and then sort every remaining line in the field. The field name should be put into the global variable LASTFIELD. -- part contents for card part 1 ----- text ----- An Apple a Day 3 2 The Rain in Spain 5 1 -- part contents for card part 7 ----- text ----- See Script -- part contents for card part 8 ----- text ----- See Script -- part contents for card part 9 ----- text ----- See Script -- part contents for card part 10 ----- text ----- See Script